<%@ Application Language="C#" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Web" %>
<script runat="server">

    void Application_Start(object sender, EventArgs e) 
    {
        //string path = Server.MapPath("~") + "\\visitor.txt";
        //if (!File.Exists(path))
        //{ File.WriteAllText(path, "25"); }
        //Application["LuotTruyCap"] = int.Parse(File.ReadAllText(path));
        //Application["Online"] = 0;
    }
    
    void Application_End(object sender, EventArgs e) 
    {
        //string path = Server.MapPath("~") + "\\visitor.txt";
        //File.WriteAllText(path, Application["LuotTruyCap"].ToString());
        //Application["Online"] = int.Parse(Application["Online"].ToString()) - 1;
    } 
    void Session_Start(object sender, EventArgs e) 
    {
        //if (ConvertType.ToInt(Application["Online"]) ==0)
        //{ Application["Online"] = 1; }
        //else
        //{
        //    Application["Online"] = (int)Application["Online"] + 1;
        //}
        //Application["LuotTruyCap"] = int.Parse(Application["LuotTruyCap"].ToString()) + 1;
        //string path = Server.MapPath("~") + "\\visitor.txt";
        //File.WriteAllText(path, Application["LuotTruyCap"].ToString());
        //if (ConvertType.ToInt(Application["Online"]) >1)
        //{
        //    Application["Online"] = int.Parse(Application["Online"].ToString()) + 1;
        //}
    }  
    void Session_End(object sender, EventArgs e) 
    {
        //int i = (int)Application["Online"];
        //if (i >=1)
        //{
        //    Application["Online"] = i - 1;
        //}        
        //string path = Server.MapPath("~") + "\\visitor.txt";
        //File.WriteAllText(path, Application["LuotTruyCap"].ToString());
        //Application["Online"] = int.Parse(Application["Online"].ToString()) - 1;
    }       
</script>
